package play.special_classes

enum class State {
    IDLE, RUNNING, FINISHED
}

enum class Color(private val rgb: Int) {
    RED(0xFF0000),
    GREEN(0x00FF00),
    BLUE(0x0000FF),
    YELLOW(0xFFFF00);

    fun containsRed() = (this.rgb and 0xFF0000 != 0)
    fun containsGreen() = (this.rgb and 0x00FF00 != 0)
    fun containsYellow() = (this.rgb and 0xFFFF00 != 0)
}


fun main() {
    val message = when (State.RUNNING) {
        State.RUNNING -> "It's running"
        State.IDLE -> "It's idle"
        State.FINISHED -> "It's finished"
    }
    println(message)

    val red = Color.RED
    println(red)
    println(red.containsRed())
    println(Color.BLUE.containsRed())
    println(Color.RED.containsRed())
    println(Color.GREEN.containsGreen())
    println(Color.YELLOW.containsYellow())

}